﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>EditForm</title>
	<style type="text/css">
		div, table, tr, td {
			margin: 0px;
			padding: 0px;
		}

		.myTable {
			Width: 800px;
			margin: 20px auto;
			border-collapse: collapse;
		}

			.myTable td {
				height: 30px;
				line-height: 30px;
				padding: 6px;
			}
	</style>
</head>
<body>
	<form method="post" action="Update">
		<input type="hidden" name="hdEmpId" value="@ViewBag.emp.EmpId"/>
		<div style="text-align:center">
			<table width="800" class="myTable" border="1">
				<tr>
					<td colspan="2" align="center" style="font-weight:bold;">员工修改</td>
				</tr>

				<tr>
					<td width="200" align="right">所属部门：</td>
					<td width="600" align="left">
						<select name="DeptId" id="DeptId">
							<option value="0">--请选择--</option>
							@foreach (var item in ViewBag.listDept)
							{
								//option前加叹号取消语法检查
								<!option value="@item.DeptId" @(item.DeptId==ViewBag.emp.DeptId?"selected":"")>@item.DeptName</!option>
							}
						</select>
					</td>
				</tr>

				<tr>
					<td width="200" align="right">员工姓名：</td>
					<td width="600" align="left"><input type="text" name="txtRealName" value="@ViewBag.emp.EmpName" /></td>
				</tr>

				<tr>
					<td width="200" align="right">员工电话：</td>
					<td width="600" align="left"><input type="text" name="txtPhone" value="@ViewBag.emp.EmpPhone" /></td>
				</tr>

				<tr>
					<td width="200" align="right">所在城市：</td>
					<td width="600" align="left"><input type="text" name="txtArea" value="@ViewBag.emp.EmpArea" /></td>
				</tr>

				<tr>
					<td width="200" align="right">月薪：</td>
					<td width="600" align="left"><input type="text" name="txtSalary" value="@ViewBag.emp.EmpSalary" /></td>
				</tr>

				<tr>
					<td width="200" align="right"></td>
					<td width="600" align="left">
						<input type="submit" value="修改" />
						<a href="Demo01">返回首页</a>
					</td>
				</tr>

			</table>
		</div>

	</form>
</body>
</html>
